/*
 * Ressource.cpp
 *
 *  Created on: 24 oct. 2010
 *      Author: seeme
 */


#include "Resource.h"

using namespace std;

void Resource::clear(){
	m_size = 0;
	m_priority = RES_MED_PRIORITY;
	m_refCount = 0;
	m_lastAccess = 0;
}

//Très important:
//Ce foncteur va permettre de trier la queue
//des ressources à dégager.
bool Resource::operator < (Resource& container){
	if(getPriority() < container.getPriority())
		return true;
	else if(getPriority() > container.getPriority())
		return false;
	else{
		if(getSize() < container.getSize())
			return true;
		else if(getSize() > container.getSize())
			return false;
	}
	return false;
}
